home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / Talking Compiler / Read Me < prev    next >
Encoding:
Text File  |  1993-06-17  |  2.6 KB  |  42 lines  |  [TEXT/ttxt]

  1. As a first step in a new initiative to bring the "Macintosh™ Advantage" to core development tools (aka the much-beloved MPW™), we have added extensive sound capability to the MPW™ port of the GNU C compiler.  Instead of those boring old error messages, Monty Python can entertain your hackers with witty remarks about their parentage, or you can add quotes from famous Apple personalities!
  2.  
  3. To use this advanced feature, you need to drag the "Commentary" folder into your MPW™ folder, or else set {Commentary} to point to the location of the rules and sound files.  Install GCC by dragging the script gC and the tools into whatever folder you like, just as long as it's on your command path.  Then you can just add the "-talk" option to your usual compiler command line, and make all your Unix™-using colleagues terribly envious!
  4.  
  5. (See the "demo" script for examples of usage.)
  6.  
  7. How It Works
  8.  
  9. Of course, it would have been bad to wire names of sound files all over the 3+ megabytes of compiler source, so there is a "Rules" file that specifies which situations map to which sounds.  I was going to make this a really powerful rule-matching language, but this is only MacHack, so the rules look like this:
  10.  
  11. <rule>:<sound name>
  12.  
  13. where <rule> is one of
  14.  
  15.     start {cpp | cc1} (start of preprocessor vs start of compiler proper)
  16.     include [<filename>]
  17.     macro [<macro name>]
  18.     function [<function name>]
  19.     call [<function name>]
  20.     error [<message substring>]
  21.     warning [<message substring>]
  22.     finish {0 | 1} (0 for no errors, 1 for errors)
  23.  
  24. If the parameter is omitted, then the rule will match any appearance of the construct.  If present, it will match any string containing the parameter as a substring (case-sensitively).
  25.  
  26. The sound name is a literal name of a sound file or a name of a resource in a "Sounds" resource file.
  27.  
  28. If several rules match, then one of the sounds will be chosen randomly.
  29.  
  30. All whitespace is significant! (good for parameter strings and sound names, bad for flexibility)  "//" makes comments as for C++.
  31.  
  32. The Compiler
  33.  
  34. Incidentally, this is the latest pre-release of the MPW port of GCC (based on version 2.3.3).  It *is* a fully working optimizing C compiler, at least if you don't count the occasional bug that surfaces around pascal functions. See the main GCC tree (on the MacHack CD or around the Internet) for full information, source code, and backends for more types of machines/systems than you even knew existed.  If you really want to use this for real hacking, be sure to update to the real release when it comes out (what, you think I'm going to commit to a schedule!?!)
  35.  
  36. Stan Shebs
  37. Meanie Doctor
  38. shebs@apple.com
  39.  
  40.  
  41.  
  42.